<!-- xml version="1.0" encoding="utf-8" -->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
<head>
	<title>De Bello Gallico</title>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
	<link href="../flashcard.css" rel="stylesheet" type="text/css">
</head>


<script type="text/javascript">
var sentences = [
  [ ["Interea", "ea", "legione", "quam", "secum", "habebat,", "militibusque", "qui", "ex", "provincia", "convenerant,"],
    ["Meanwhile", "by-that", "legion", "which", "with-him", "he-had,", "by-soldiers-also", "who", "out-of", "province", "had-come-together,"] ],
  [ ["a", "lacu", "Lemanno,", "qui", "in", "flumen", "Rhodanum", "influit,", "ad", "montem", "Iuram,", "qui", "fines", "Sequanorum", "ab", "Helvetiis", "dividit,"],
    ["from", "lake", "Leman,", "which", "into", "river", "Rhone", "in-flows,", "to", "mount", "Jura,", "which", "territories", "of-Sequani", "from", "Helvetii", "divides,"] ],
  [ ["milia", "passuum", "decem", "novem", "murum", "in", "altitudinem", "pedum", "sedecim", "fossamque", "perducit."],
    ["thousands", "of-paces", "ten", "nine", "wall", "in", "height", "of-feet", "sixteen", "ditch-also", "he-leads-along."] ],
  [ ["Eo", "opere", "perfecto", "praesidia", "disponit,", "castella", "communit,", "quo", "facilius,"],
    ["By-that", "work", "having-been-perfected", "garrisons", "at-different-points-he-places,", "forts", "fortifies-strongly,", "by-which", "more-easily,"] ],
  [ ["si", "se", "invito", "transire", "conarentur,", "prohibere", "possit."],
    ["if", "he", "[being]_unwilling", "over-to-cross", "they-should-attempt,", "to-prevent", "he-may-be-able."] ],
  [ ["Vbi", "ea", "dies", "quam", "constituerat", "cum", "legatis", "venit,", "et", "legati", "ad", "eum", "reverterunt,"],
    ["When", "that", "day", "which", "he-had-agreed-upon", "with", "legates", "came,", "and", "legates", "to", "him", "returned,"] ],
  [ ["negat", "se", "more", "et", "exemplo", "populi", "Romani", "posse", "iter", "ulli", "per", "provinciam", "dare", "et,"],
    ["he-denies", "himself", "by-custom", "and", "precedent", "of-people", "Roman", "to-be-able", "passage", "to-any", "through", "province", "to-grant", "and,"] ],
  [ ["si", "vim", "facere", "conentur,", "prohibiturum", "ostendit."],
    ["if", "violence", "to-do", "they-attempt,", "(himself)_about-to-prevent_(to-be)", "he-declares."] ],
  [ ["Helvetii", "ea", "spe", "deiecti,", "navibus", "iunctis", "ratibusque", "compluribus", "factis,"],
    ["Helvetii", "from-that", "hope", "downcast,", "boats", "having-been-joined", "rafts-also", "very-many", "having-been-made,"] ],
  [ ["alii", "vadis", "Rhodani,", "qua", "minima", "altitudo", "fluminis", "erat,"],
    ["others", "by-fords", "of-Rhone,", "where", "least", "depth", "of-stream", "was,"] ],
  [ ["nonnumquam", "interdiu,", "saepius", "noctu,", "si", "perrumpere", "possent", "conati,"],
    ["not-never", "during-day,", "more-often", "by-night,", "whether", "to-break-through", "they-were-able", "having-tried,"] ],
  [ ["operis", "munitione", "et", "militum", "concursu", "et", "telis", "repulsi", "hoc", "conatu", "destiterunt."],
    ["of-[the]-work", "by-[the]-fortification", "and", "of-[the]-soldiers", "by-together-[the]-running", "and", "by-missiles", "repulsed", "from-this", "attempt", "they-desisted."] ]
];

var i = 0;
var j = 0;

var shown = 0;

function updateVoc() {
	
	var sentence = "";
	
	for(n = 0; n < sentences[i][0].length; n++) {
		if (n == j) {
			sentence += ' <span class="curword">' + sentences[i][0][n] + "</span>";
		} else {
			sentence += " " + sentences[i][0][n];
		}
	}
	
	document.getElementById('v3').innerHTML = sentence;
	
	if (shown == 0) {
		document.getElementById('v1').innerHTML = "";
	} else {
		document.getElementById('v1').innerHTML = sentences[i][1][j];
	}
}

function next() {
	shown++;
	if (shown > 1) {
		shown = 0;
		j++;
		if (j >= sentences[i][0].length) {
			j = 0;
			i++;
			if (i >= sentences.length) {
				i = 0;
				alert('All done!');
			}
		}
	}
	updateVoc();
}

function prev() {
	shown--;
	if (shown < 0) {
		shown = 1;
		j--;
		
		if (j < 0) {
			i--;
			if (i < 0) {
				i = sentences.length - 1;
				alert('All done!');
			}
			j = sentences[i][0].length - 1;
		}
	}
	
	updateVoc();
}

</script>

<body onload="updateVoc()">
<h1 style="text-align:center; color: #60B0C0;">Liber I - Caput VIII</h1>

<div class="center">
<div id="v3" class="v3"></div>
<div id="v2" class="v2">&nbsp;</div>
<div id="v1" class="v1"></div>


<a href="#" class="button" id="btnprev" onclick="prev()" accesskey="p">&lt;&lt;</a>
<a href="#" class="button" id="btnnext" onclick="next()" accesskey="n">&gt;&gt;</a>


</div>
</body>
</html>
